package helper.base.function

import org.junit.Test

internal class FunctionArgHelperTest {
    class Valuation(
        val vs: ArrayList<Double>,
    ) {
        fun getAverage(): Double {
            val average = vs.average()
            println("getAverage=${average}")
            return average
        }

        fun getSum() = vs.sum()
    }

    fun task1(
        va: Valuation,
        theFun: Valuation.() -> Double
    ) {
        va.theFun()
    }

    @Test
    fun t1() {
        val va = Valuation(
            arrayListOf(0.1, 1.1, 2.1)
        )
        task1(va, Valuation::getAverage)
    }
}